package com.tsunami.authority.entity.auth;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tsunami.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 角色组织关系表
 * </p>
 *
 * @author lx
 * @since 2021-09-23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("tnm_auth_role_org")
@ApiModel(value="RoleOrg", description="角色组织关系")
public class RoleOrg extends SuperEntity<Long> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "租户号")
    @TableField(value = "tenant_id")
    private Long tenantId;

    @ApiModelProperty(value = "角色ID")
    @TableField(value = "role_id")
    private Long roleId;

    @ApiModelProperty(value = "组织ID")
    @TableField(value = "org_id")
    private Long orgId;

    @Builder
    public RoleOrg(Long id, LocalDateTime createTime, Long createUser,
                   Long roleId, Long orgId) {
        this.id = id;
        this.createTime = createTime;
        this.createUser = createUser;
        this.roleId = roleId;
        this.orgId = orgId;
    }
}
